<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>magedu.com</title>
</head>
<body>


<h2>习题1-奇偶行列表输出</h2>

<ul>
{% for i in mydict.c %}
{% if forloop.counter|divisibleby:2 %}
    <li style="color: red">第{{ forloop.counter }}行 : {{ i|add:100 }}<br></li>
{% else %}
    <li style="color: dodgerblue">第{{ forloop.counter }}行 : {{ i|add:100 }}<br></li>
{% endif %}
{% endfor %}
</ul>


<h2>习题2-打印九九方阵</h2>
<table>
{% for x in mydict.range9 %}
    {% if forloop.counter|divisibleby:2 %}
    <tr bgcolor="red">
        {% for y in mydict.range9 %}
        <td>{{ x }} * {{ y }} = {% widthratio x 1 y %}</td>
        {% endfor %}
    </tr>
    {% else %}
    <tr bgcolor="dodgerblue">
        {% for y in mydict.range9 %}
        <td>{{ x }} * {{ y }} = {% widthratio x 1 y %}</td>
        {% endfor %}
    </tr>
    {% endif %}
{% endfor %}
</table>



</body>
</html>
